﻿<!DOCTYPE html>
<html>
<head>
    <style>
        b
        {
            color: red;
            font-size: 16px;
            display: block;
            clear: left;
        }
        div, span, p
        {
            width: 40px;
            height: 40px;
            float: left;
            margin: 10px;
            background-color: blue;
            padding: 3px;
            color: white;
        }
    </style>
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
    <span>span</span>
    <p>
        p</p>
    <p>
        p</p>
    <div>
        div</div>
    <span>span</span>
    <p>
        p</p>
    <div>
        div</div>
    <b></b>
    <script type="text/javascript">
        var list = $("div,p,span").map(function () {
            return this.tagName;
        }).get().join(", ");
        $("b").append(document.createTextNode(list));
    </script>
</body>
</html>
